<{capture name="header"}>
<{css src="template.css" app="desktop" }>
<style> 
div.workground{padding:0;}
</style>
<{/capture}>

<script>
Ex_Loader('modedialog',function(){});

   function _addWeigets(args){
      var themeFrame=$('themeFrame').contentWindow;
    
      var shopWidgetsOBJ=themeFrame.shopWidgets;
        _widgetsDialog?_widgetsDialog.close():'';
        _widgetsDialog=null;
        shopWidgetsOBJ.ghostDrop(args[0],args[1]);
        themeFrame.focus();
   }

   function _showWidgetsDialog(url){     
	
    _widgetsDialog=new Dialog(url,{width:770,height:500,title:'<{t}>增加页面版块<{/t}>',modal:true,resizeable:false,onShow:function(e){
     this.dialog_body.id='dialogContent';
  }});    
	
   }

   function _saveWidgets(){
    return $("themeFrame").contentWindow.shopWidgets.saveAll();
   }
   	 
    $('main').setStyle('overflow','hidden');  
	var SHOPADMINDIR = '<{$shopadmin}>';
</script>
<{capture name="headbar"}>
<div id="wg_toolbar" class="toolbar clearfix">
		<div class="flt"><strong><{t}>模板可视化编辑<{/t}></strong>( <{$viewname}><i class="f-9 c-gray"><{$view}></i> )</div>
		<div class="span-auto">&nbsp;</div>
		<div class="flt">
			<a class="tbbtn add" href="javascript:void(0)" onclick="_showWidgetsDialog('index.php?app=site&ctl=admin_theme_widget&act=add_widgets_page&theme=<{$theme}>')">
				<span>	<{t}>添加版块<{/t}><span>
			</a>
		</div>
		<div class="frt">
			<a class="tbbtn save" href="javascript:void(0)" onclick="if(confirm('<{t}>确定保存您对当前页面的修改吗?<{/t}>'))_saveWidgets()">
				<span>	<{t}>保存<{/t}></span>
			</a>
			<a class="tbbtn view" href="<{$site_url}>" target="_blank">
				<span>	<{t}>浏览<{/t}></span>
			</a>
			<a class="tbbtn exit" href="javascript:void(0)" onclick="if(confirm('<{t}>确定退出?<{/t}>'))window.close()">
				<span>	<{t}>退出<{/t}></span>
			</a>
		</div>

</div>
<{/capture}>

  <iframe id="themeFrame" frameborder="0" width='100%' height='100%' src="index.php?app=site&ctl=admin_theme_widget&act=preview&theme=<{$theme}>&file=<{$view}>"></iframe>




